Radio Button Values

This script uses onClick events to capture changing information about a radio button set.
One: Two: Three:

Discussion

When only one of a set of values may be valid, use radio buttons rather than a series of standard buttons. You don't have to store "prior value", "new value", etc.
function pressed(aRadioButton)
{
    alert("You pressed "+aRadioButton.value)
}

One:<INPUT TYPE="radio" NAME="myradio" VALUE="one"
    onClick="pressed(this)">
Copyright ©1998 by Charles River Media, All Rights Reserved